package cn.funeralobjects.ams.web.controller;

import cn.funeralobjects.ams.entity.EProductRes;
import cn.funeralobjects.ams.model.ProductRes;
import cn.funeralobjects.ams.service.BaseAmsService;
import cn.funeralobjects.ams.service.ProductResService;
import cn.funeralobjects.ams.web.api.ProductResApi;
import cn.funeralobjects.ams.web.mapper.ProductResMapper;
import cn.funeralobjects.ams.web.model.MProductRes;
import cn.funeralobjects.ams.web.model.VProductRes;
import cn.funeralobjects.common.service.EnableService;
import cn.funeralobjects.common.service.NameService;
import cn.funeralobjects.common.web.controller.RestEnableController;
import cn.funeralobjects.common.web.controller.RestNameController;
import cn.funeralobjects.common.web.controller.converter.ModelMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author FuneralObjects
 * Create date: 2020/5/26 10:29 AM
 */
@RestController
@RequestMapping("/product-res")
public class ProductResController implements ProductResApi, BaseAmsController<VProductRes, MProductRes, ProductRes, EProductRes, Integer>, RestNameController<VProductRes, EProductRes, Integer>, RestEnableController<VProductRes, EProductRes, Integer> {

    @Resource
    private ProductResService productResService;

    @Resource
    private ProductResMapper productResMapper;

    @Override
    public BaseAmsService<ProductRes, EProductRes, Integer> baseAmsService() {
        return productResService;
    }

    @Override
    public ModelMapper<MProductRes, ProductRes, EProductRes, VProductRes> modelMapper() {
        return productResMapper;
    }

    @Override
    public NameService<EProductRes, Integer> nameService() {
        return productResService;
    }

    @Override
    public EnableService<EProductRes, Integer> enableService() {
        return productResService;
    }
}
